package dao

import (
	"rabbit/global"
	"rabbit/internal/model"
)

func GetListChat(userId uint) []model.ChatHistory {
	var req []model.ChatHistory
	if err := global.DB.Order("created_at desc").Where("form_user_id = ?", userId).Find(&req).Error; err != nil {
		return []model.ChatHistory{}
	}
	return req
}
